Harmonizing Signals and Events with a Lightweight Extension to Java
نویسندگان
چکیده
The current demands for seamless connections with the surrounding environment make software more reactive. For example, such demands are evident in systems consisting of the Internet of Things. Such systems include a set of reactive values that are periodically updated in response to external or internal events to form a dataflow in the sense that such updates are propagated to other reactive values. Two effective approaches for realizing such reactive values have been proposed: the event mechanisms in event-based programming and the signals in functional-reactive programming. These two approaches are now becoming mixed in several languages such as Flapjax and REScala, which makes these languages notably expressive for modularizing the implementation of reactive software. For example, REScala provides a rich API that consists of functions converting events to signals and vice versa. In this paper, we explore another, simpler approach in the design space of reactive programming languages: the event mechanism is harmonized with signals, resulting in a simplified programming interface that is mostly based on signals. Based on this approach, we realize SignalJ, a simple extension of Java with events and signals. Our notable findings are (1) an event can be represented as an update of a signal and (2) such an effectful signal can be represented using annotations instead of introducing types and constructors for signals to further simplify the language. Another contribution of this paper is the formal model of SignalJ. As both mechanisms of events and signals may interfere with each other, this mixing sometimes results in surprising behavior. For example, the functional behavior of signals is affected by the imperative features of events. Thus, understanding the formal model of this mixing is actually important. The core calculus, Featherweight SignalJ (FSJ), was developed as an extension of Featherweight Java, and proofs are provided to ensure the soundness of FSJ.
منابع مشابه
EventJava: An Extension of Java for Event Correlation
Event correlation has become the cornerstone of many reactive applications, particularly in distributed systems. However, support for programming with complex events is still rather specific and rudimentary. This paper presents EventJava, an extension of Java with generic support for event-based distributed programming. EventJava seamlessly integrates events with methods, and broadcasting with ...
متن کاملLightweight Nested Inheritance in Layer Decomposition
Software is often constructed as a stack of layers where a sublayer extends its superlayer. Such extension of layers requires extension of mutually recursive classes that form a layer. Furthermore, a class within a layer often inherits from another class within the same layer, and this inheritance relation is preserved in the sublayer. Supporting these features in a type-safe object-oriented la...
متن کاملنقش حروف ربط زمان دار در تعیین رابطۀ زمانی بین رویدادهای فعلی در پیکرۀ متون زبان فارسی معاصر
This paper involves in prediction of temporal relation between tensed-verb events on the basis of conjunctions in texts. For this purpose, tensed verb event data were extracted from Contemporary Persian Corpus and were examined carefully. The temporal relations between events were identified. After analyzing data on the basis of temporal relation according to Bird’s and Allen’s categorization, ...
متن کاملSimulation of Rainfall - Runoff Events by Applying Phase Differences Diagrams and Correcting Effective Rainfall Components
The conversion of rainfall to runoff in basins includes nonlinear relations between the complex interactions of various hydrological processes. In this study, without considering of predetermined structure, relationship between input and output system was derived individually from the nature of the data recorded. Also, the phase difference occurred between rainfall and runoff signals using c...
متن کاملMacroscopic Visualization of the Heart Electrical Activity Via an Algebraic Computer Model
In this study, a mathematical model is developed based on algebraic equations which is capable of generating artificially normal events of electrocardiogram (ECG) signals such as P-wave, QRS complex, and T-wave. This model can also be implemented for the simulation of abnormal phenomena of electrocardiographic signals such as ST-segment episodes (i.e. depression, elevation, and sloped ascending...
متن کامل